Showcase Data Model
Manual and Auto Showcases includes Base Showcase Entity.
Base Showcase Entity
/// <summary>
/// Base showcase entity
/// </summary>
public class Showcase : BaseModel
{
public string AppId { get; set; }
public LocalizedField<string> Name { get; set; }
}
Manual Showcase Entity
[BsonIgnoreExtraElements]
public class ManualShowcase : Showcase
{
public List<ProductList> Products { get; set; } = new List<ProductList>();
}
[BsonIgnoreExtraElements]
public class ProductList
{
public string ProductId { get; set; }
public int OrderIndex { get; set; } = 1;
}
Auto Showcase Entity
/// <summary>
/// Automated Showcase entity
/// </summary>
[BsonIgnoreExtraElements]
public class AutoShowcase : Showcase
{
public ShowcaseFilter ShowcaseFilter { get; set; }
}
public class ShowcaseFilter : PaginationFilterBase
{
public string Name { get; set; }
public Range<int> Price { get; set; }
public Range<int> Stock { get; set; }
public Range<DateTime> CreateDate { get; set; }
[ArraySearchFiltering]
public List<string> CategoryId { get; set; }
public OrderByOption OrderBy { get; set; } = OrderByOption.OrderByDescending;
public OrderByProductOption OrderByProductOption { get; set; } = OrderByProductOption.Stock;
}
This filter object can expand very easily, so auto showcase implementation is easier.